package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HaManufacturerMapper;
import com.ruoyi.system.domain.HaManufacturer;
import com.ruoyi.system.service.IHaManufacturerService;

/**
 * 生产厂家Service业务层处理
 * 
 * @author 鲍小伟
 * @date 2025-11-21
 */
@Service
public class HaManufacturerServiceImpl implements IHaManufacturerService 
{
    @Autowired
    private HaManufacturerMapper haManufacturerMapper;

    /**
     * 查询生产厂家
     * 
     * @param mid 生产厂家主键
     * @return 生产厂家
     */
    @Override
    public HaManufacturer selectHaManufacturerByMid(Integer mid)
    {
        return haManufacturerMapper.selectHaManufacturerByMid(mid);
    }

    /**
     * 查询生产厂家列表
     * 
     * @param haManufacturer 生产厂家
     * @return 生产厂家
     */
    @Override
    public List<HaManufacturer> selectHaManufacturerList(HaManufacturer haManufacturer)
    {
        return haManufacturerMapper.selectHaManufacturerList(haManufacturer);
    }

    /**
     * 新增生产厂家
     * 
     * @param haManufacturer 生产厂家
     * @return 结果
     */
    @Override
    public int insertHaManufacturer(HaManufacturer haManufacturer)
    {
        haManufacturer.setCreateTime(DateUtils.getNowDate());
        return haManufacturerMapper.insertHaManufacturer(haManufacturer);
    }

    /**
     * 修改生产厂家
     * 
     * @param haManufacturer 生产厂家
     * @return 结果
     */
    @Override
    public int updateHaManufacturer(HaManufacturer haManufacturer)
    {
        haManufacturer.setUpdateTime(DateUtils.getNowDate());
        return haManufacturerMapper.updateHaManufacturer(haManufacturer);
    }

    /**
     * 批量删除生产厂家
     * 
     * @param mids 需要删除的生产厂家主键
     * @return 结果
     */
    @Override
    public int deleteHaManufacturerByMids(Integer[] mids)
    {
        return haManufacturerMapper.deleteHaManufacturerByMids(mids);
    }

    /**
     * 删除生产厂家信息
     * 
     * @param mid 生产厂家主键
     * @return 结果
     */
    @Override
    public int deleteHaManufacturerByMid(Integer mid)
    {
        return haManufacturerMapper.deleteHaManufacturerByMid(mid);
    }
}
